//{====================================================================================
//! @file Var1taskCotv.c
//! @date    2013-09-29 20:45
//! @author Andrianov Georgiy <egor.andrianov81@gmail.com>
//!
//! Programm checks, can you weigh number on balance with
//! mass = 4 ^ k (k = 0, 1, 2...
//!
//! @par The programme enters number
//!      It needs to output YES if you can weigh this number
//!                         NO if you cannot weigh this number
//}====================================================================================

#include <stdio.h>
#include <math.h>

int proverka(int a);

int main()
{
    long n = 0;
    scanf("%i", &n);
    if (proverka(n) == 1)
    {
        printf("YES");
    }
    else
    {
        printf("NO");
    }
    return 0;
}

//! proverka - checks, can you weight this number or not
//!
//! @param      a   number
//!
//! @return         1 - if you can
//!                 0 - if you can not

int proverka(int a)
{
    if ((a == 4) || (a == 1))
    {
        return 1;
    }
    if (a % 4 == 2)
    {
        return 0;
    }
    else
    {
        if ((a % 4 == 1) || (a % 4 == 0))
        {
            if (proverka(a / 4) == 1)
            {
                return 1;
            }
        }
        if (a % 4 == 3)
        {
            if (proverka((a+1)/4) == 1)
            {
                return 1;
            }
        }
    }
    return 0;
}
